package com.cy.wenxinapi.controller;

import com.cy.wenxinapi.service.InterviewRecodeService;
import com.cy.wenxinapi.util.Result;
import com.cy.wenxinapi.vo.InterviewParamsVo;
import com.cy.wenxinapi.vo.QAstr;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: c
 * @date: 2024/3/22 13:52
 * @description:
 */

@RestController
public class newController {


    @Resource
    private InterviewRecodeService interviewRecodeService;


    //获取面试ID，并根据简历内容生成题目
    @RequestMapping("getInterviewID")
    public Result getInterviewID(@RequestBody InterviewParamsVo vo) {
        String InterviewID = interviewRecodeService.generateInterviewID(vo);
        return Result.ok(InterviewID);
    }


    //获取简历list
    @RequestMapping("getInterviewList")
    public Result getInterviewList() {
        return interviewRecodeService.getInterviewList();
    }

    //通过面试ID获取题目
    @RequestMapping("getQuestionForInterview")
    public Result getQuestionForInterview(String interviewId) throws InterruptedException {
        return interviewRecodeService.getQuestionForInterview(interviewId);
    }


    //获取面试结果
    @RequestMapping("getInterviewResult")
    public Result getInterviewResult(@RequestBody QAstr qAstr) {
        return interviewRecodeService.getInterviewResult(qAstr);
    }

    //获取标准答案
    @RequestMapping("getBestAnswer")
    public Result getBestAnswer(String question,String interviewId) {
        return interviewRecodeService.getBestAnswer(question, interviewId);
    }

    @RequestMapping("getInterviewerAnswer")
    public Result getInterviewerAnswer(String question,String interviewId) {
        return interviewRecodeService.getInterviewerAnswer(question, interviewId);
    }
}
